<template>

  <el-form :model="tableData" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
    <el-card class="box-card">
      <span>基本信息</span>
      <div class="text item">
        <el-form-item label="订单号">
          <el-input v-model="tableData.orderNumber" disabled></el-input>
        </el-form-item>
        <el-form-item label="申请时间">
          <el-input :value="getDate(tableData.addTime)" disabled></el-input>
        </el-form-item>
        <el-form-item label="订单状态">
          <el-input v-model="tableData.statusString" disabled></el-input>
        </el-form-item>
        <el-form-item label="业务员">
          <el-input v-model="tableData.businessSysUsersName" disabled></el-input>
        </el-form-item>
        <el-form-item label="融资经销商">
          <el-input v-model="tableData.dealerName" disabled></el-input>
        </el-form-item>
        <el-form-item label="汽车总数量">
          <el-input v-model="tableData.carSumNumber" disabled></el-input>
        </el-form-item>
        <el-form-item label="采购总金额(元)">
          <el-input :value="tableData.purchaseSumMoney| toFixed2" disabled></el-input>
          <span class="convertCurrency">{{tableData.purchaseSumMoney|convertCurrency}}</span>
        </el-form-item>
        <el-form-item label="融资总金额(元)">
          <el-input :value="tableData.mortgageSumMoney| toFixed2" disabled></el-input>
          <span class="convertCurrency">{{tableData.mortgageSumMoney|convertCurrency}}</span>
        </el-form-item>

        <el-form-item label="初始融资周期">
          <el-input v-model="tableData.durationName" disabled></el-input>
        </el-form-item>
        <el-form-item label="初始融资利率">
          <el-input :value="tableData.mortgageInterestRate| toFixed4" disabled></el-input>
        </el-form-item>
        <el-form-item label="延期融资利率">
          <el-input :value="tableData.interestRate| toFixed4" disabled></el-input>
        </el-form-item>
        <el-form-item label="延期融资周期">
          <el-input v-model="tableData.delayDurationName" disabled></el-input>
        </el-form-item>
        <el-form-item label="融资比例(%)">
          <el-input :value="(((tableData.mortgageSumMoney)/(tableData.purchaseSumMoney)*100-0).toFixed(2)||'')+'%'" disabled></el-input>
        </el-form-item>

        <el-form-item label="收款账户名">
          <el-input v-model="tableData.accountName" disabled></el-input>
        </el-form-item>
        <el-form-item label="收款账号">
          <el-input v-model="tableData.accountNumber" disabled></el-input>
        </el-form-item>
        <el-form-item label="开户行">
          <el-input v-model="tableData.openningBank" disabled></el-input>
        </el-form-item>
        <el-form-item label="资源审核意见">
          <el-input v-model="tableData.resourceAuditOpinion" disabled></el-input>
        </el-form-item>

        <el-form-item label="资源审核人">
          <el-input v-model="tableData.resourceAuditPeople" disabled></el-input>
        </el-form-item>
        <el-form-item label="资源初审时间">
          <el-input :value="getDate(tableData.resourceAuditTime)" disabled></el-input>
        </el-form-item>
        <el-form-item label="资源复审时间">
          <el-input :value="getDate(tableData.reviewAuditTime)" disabled></el-input>
        </el-form-item>
        <el-form-item label="物管验车意见">
          <el-input v-model="tableData.propertyInspectionOpinion" disabled></el-input>
        </el-form-item>

        <el-form-item label=" 物管审核人">
          <el-input v-model="tableData.propertyInspectionPeople" disabled></el-input>
        </el-form-item>
        <el-form-item label="物管审核时间">
          <el-input :value="getDate(tableData.propertyInspectionTime)" disabled></el-input>
        </el-form-item>


        <el-form-item label="风控审核意见">
          <el-input v-model="tableData.riskAuditOpinion" disabled></el-input>
        </el-form-item>
        <el-form-item label="风控审核人">
          <el-input v-model="tableData.riskAuditPeople" disabled></el-input>
        </el-form-item>
        <el-form-item label="风控审核时间">
          <el-input :value="getDate(tableData.riskAuditTime)" disabled></el-input>
        </el-form-item>
      </div>
    </el-card>
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span>合同信息</span>
      </div>
      <el-form-item label="资金方">
        <el-input v-model="tableData.funderName" disabled></el-input>
      </el-form-item>
      <el-form-item label="SPV">
        <el-input v-model="tableData.spvName" disabled></el-input>
      </el-form-item>
    </el-card>
    <el-card>
      <div id="tableBox" style="margin:0 25px;">
        <el-table :data="tableData.templateInfoListVO" border>
          <el-table-column label="合同名称">
            <template scope="scope">
              <span>{{ scope.row.outName }}</span>
            </template>
          </el-table-column>
          <el-table-column label="合同别名" >
            <template scope="scope">
              <span>{{ scope.row.name }}</span>
            </template>
          </el-table-column>
          <el-table-column label="合同状态" >
            <template scope="scope">
              <span>{{ scope.row.statusCH }}</span>
            </template>
          </el-table-column>
        </el-table>

      </div>
    </el-card>

  </el-form>
</template>

<script>
  import qiniu from '@/views/qiniu/upload';
  import {
    timestampToTime
  } from '@/utils/index.js';

  export default {
    data() {
      return {
        ruleForm: {

        },
        rules: {


        },
        qiniuImage: {
          id: "qiniuImage", //图片预览的id   
          image_uri: [
            'http://h.hiphotos.baidu.com/image/h%3D300/sign=6ee370b8861363270aedc433a18fa056/11385343fbf2b211ec2f692ac68065380cd78e55.jpg'
          ], //图片上传的列表  只含有url地址
        },
        radio: '1'
      };
    },
    methods: {
      submitForm(formName) {
        this.$refs[formName].validate(valid => {
          if (valid) {
            alert("submit!");
            this.dialogSendData.dialogFormVisible = false;

          } else {
            console.log("error submit!!");
            return false;
          }
        });
      },
      resetForm(formName) {
        this.$refs[formName].resetFields();
        this.dialogSendData.dialogFormVisible = false;
      },
      getDate(time) {
        return timestampToTime(time)
      }

    },
    props: {
      dialogSendData: {
        type: Object
      },
      tableData: {
        type: Object
      }
    },
    mounted() {
      // console.log(this.dialogSendData)
    },
    components: {
      qiniu
    },
  };

</script>

<style lang="scss" scoped>
  .text {
    font-size: 14px;
  }

  .item {
    margin-bottom: 18px;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }

  .clearfix:after {
    clear: both;
  }

  .box-card {
    margin-top: 20px;
  }

  .align {
    margin: 50px auto 0;
    text-align: center;
  }

</style>

